{% load static %}
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>userlist</title>
    <link rel="stylesheet" href="{% static 'css/bootstrap-3.3.7-dist/css/bootstrap.min.css' %}">
</head>
<body>
<div class="container">
    <div class="row">
        <div class="col-md-8 col-md-offset-2">
            <table class="table table-bordered table-striped table-hover">
                <thead>
                <tr>
                    <th>序号</th>
                    <th>id</th>
                    <th>username</th>
                    <th>password</th>
                    <th>age</th>
                    <th>编辑</th>
                </tr>
                </thead>
                <tbody>
                    {% for user in users %}
                        <tr>
                            <td>{{ forloop.counter }}</td>
                            <td>{{ user.id }}</td>
                            <td>{{ user.username }}</td>
                            <td>{{ user.password }}</td>
                            <td>{{ user.age }}</td>
                            <td>
                                <a href="{% url 'edit' %}?id={{ user.id }}" class="btn btn-primary">编辑</a>
                                <a href="{% url 'delete' user.id %}" class="btn btn-danger">删除</a>
                            </td>
                        </tr>
                    {% endfor %}
                </tbody>
            </table>
        </div>
    </div>
</div>

</body>
</html>